/**
 * Created by howie on 2017/6/5.
 */
export default {
  isLogin(){
    let uid = this.getToken()
    if (!uid) {
      return false
    }
    return true

  },
  saveToken(token){
    localStorage.setItem('token', token)
  },
  getToken(){
    return localStorage.getItem('token')
  },
  clearToken(){
    localStorage.setItem('token', '')
  },
  saveName(name){
    localStorage.setItem('name', name)
  },
  getName(){
    return localStorage.getItem('name')
  },
  clearName(){
    localStorage.setItem('name', '')
  },
  saveLevel(level){
    localStorage.setItem('level', level)
  },
  getLevel(){
    return localStorage.getItem('level')
  },
  clearLevel(){
    localStorage.setItem('level', '')
  }
}
